Anthropic Token Counting#1749
Open
TimPansino wants to merge 10 commits into
Open
Conversation
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1749 +/- ##
=======================================
Coverage 81.67% 81.68%
=======================================
Files 215 215
Lines 26417 26438 +21
Branches 4171 4177 +6
=======================================
+ Hits 21576 21595 +19
+ Misses 3440 3434 -6
- Partials 1401 1409 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
umaannamalai
reviewed
Jun 9, 2026
| ) | ||
| ) | ||
| if input_message_content: | ||
| response_prompt_tokens = token_count_callback(request_model, input_message_content) |
Contributor
There was a problem hiding this comment.
I wonder if we should put the token count callback invocations inside of a specific try-except block so we can log out an error message with details if the customer's callback function failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview